<?php
/*
 * @Descripttion: 
 * @version: 1.0
 * @Author: Sam
 * @Date: 2022-03-26 01:16:12
 * @LastEditors: Sam
 * @LastEditTime: 2022-10-19 13:58:38
 */
declare (strict_types=1);

namespace app\common\exception;


use app\common\traits\ResponseJson;
use think\exception\Handle;
use think\Request;
use think\Response;
use think\facade\Db;
use Throwable;

class ExceptionHandle extends Handle
{
    

    /**
     * Render an exception into an HTTP response.
     * @access public
     * @param Request $request
     * @param Throwable $e
     * @return Response
     */
    public function render($request, Throwable $e): Response
    {   
        
        return json( ['code' => 500, 'line' => $e->getLine(), 'message' => $e->getMessage(), 'file' => $e->getFile()]);
    }
}
